<?php
// +----------------------------------------------------------------------
// | Copyright (c) 2017 https://git.oschina.net/honoryao All rights reserved.
// +----------------------------------------------------------------------
// | Author: v-lest <v-lest@qq.com>-2017/7/10
// +----------------------------------------------------------------------
// | app\admin\controller-Main  首页
// +----------------------------------------------------------------------


namespace app\home\controller;
use app\common\controller\Base;
class Main extends Base
{
    public function _initialize()
    {
        parent::_initialize(); // TODO: Change the autogenerated stub

    }

    public function index()
    {
        $Sectionlist=model('Section')->field('id,name')->order('id asc')->select();
        $Userlist=model('User')->group('section')->field('count(id) as number,section')->order('section asc')->select();
        $this->assign('Sectionlist',$Sectionlist);
        $this->assign('Userlist',$Userlist);
        return view();

    }

    public function _empty(){
        return view('error/index');
    }
}